<?php
  $pid = $_GET['pid'];
  $con = mysql_connect("mysql1.000webhost.com", "a7424976_info", "thebest5");
	$res = mysql_select_db("a7424976_info");
	
	$queryres = mysql_query("select * from inventory where state=$pid");
	
	echo "<HTML>
        <HEAD>
          <TITLE>&#51077;&#44256; &#47785;&#47197;</TITLE>
          <link rel='stylesheet' type='text/css' href='table.css'/>
        </HEAD>
          <BODY>
            <TABLE BORDER='0'>
            <thead>
        	    <tr>
        	       <th id='a1' scope='col'>&#54408;&#47785;</th>
        	       <th id='fn' scope='col'>&#45800;&#44032;(&#50896;)</th>
        	       <th id='fn' scope='col'>&#44060;&#49688;(EA)</th>
        	       <th id='fn' scope='col'>&#51077;&#44256;&#45216;&#51676;</th>
        	       <th id='fn' scope='col'>&#52636;&#44256;&#45216;&#51676;</th>
           	    </tr>        	    
        	  </thead>";
        	  
  while($row = mysql_fetch_row($queryres)){
    echo "<tr>";
    $mm = date("Ymd h:i:s", mktime(date("h"),date("i"),date("s"),date("m"), date("d"), date("Y")));
    if ($pid == 0){
      for ($c=1; $c<=3; $c++){
        echo "<th scope='row'>$row[$c]</th>";
      }
      echo "<th scope='row'>$mm</th>";    
      echo "<th scope='row'>----------------------</th>";
    }
    else if ($pid == 1){
      for ($c=1; $c<=3; $c++){
        echo "<th scope='row'>$row[$c]</th>";
      }
        echo "<th scope='row'>$mm</th>";
        $mn = date("Ymd h:i:s", mktime(date("h"),date("i"),date("s"),date("m"), date("d"), date("Y")));
        echo "<th scope='row'>$mn</th>";
    }
    echo "</tr>";
	}
	mysql_close($con);
	echo "</TABLE>
  </BODY>
      </HTML>";

?>